package com.examsystem.util;

import com.examsystem.config.DynamicTaskService;
import com.examsystem.pojo.PaperClass;
import com.examsystem.pojo.vo.PaperClassVo;
import com.examsystem.pojo.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Administrator
 */
@Service("autoHandler")
public class AutoHandler {
    @Autowired
    private DynamicTaskService dynamicTaskService;

    public Result autoHandler(int paperId, int studentId, int classId){
        PaperClassVo paperClassVo = new PaperClassVo();
        PaperClass paper = new PaperClass();
        paper.setPcPaper(paperId);
        paper.setPcClass(classId);
        paperClassVo.setPaperClass(paper);
        new Thread(new Handler(paperClassVo,studentId)).start();
        return Result.succ("ok");
    }
}